<template>
    <div>
        <div class="item">
            <div class="left">
                <img :src="books.src" />
            </div>
            <div class="middle">
                <div class="bookname">{{ books.name }}</div>
                <span>{{ books.master }}</span>
                <div>
                    <span class="span-icon">都市生活</span>
                    <span class="span-icon1">{{ books.readNum }}</span>
                </div>
                <div class="bookinfo">{{ books.intro }}</div>
            </div>
            <div class="right">
                <img src="../../img/icon1.png">
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        props:['books'],
    }
</script>

<style lang="scss" scoped>
.item{
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    color: #ccc;
    font-size: 14px;
    .left {
        width: 100px;
        height: 125px;
        margin-left: 15px;
        img {
        width: 94px;
        height: 100%;
        }
    }

    .middle {
        display: flex;
        // 修改主轴方向，改为Y轴方向
        flex-direction: column;
        // 主轴对齐方式 两端对齐
        justify-content: space-between;
        width: 220px;
        margin-left: 10px;
        .span-icon{
            font-size: 14px;
            margin-right: 10px;
            border: 1px solid #ccc;
            border-radius: 20px;
        }
        .span-icon1{
            font-size: 14px;
            margin-right: 10px;
            border: 1px solid #99cccc;
            border-radius: 20px;
            color:#99cccc;
        }
        .bookname{
        color: #666;
        font-size: 18px;
        }

       .bookinfo{
        // 文字超过宽度区域，用...
        width: 220px;
        overflow: hidden; //超出部分隐藏
        text-overflow: ellipsis; //当对象内文本溢出时显示省略标记（...）
        display: -webkit-box; //弹性伸缩盒子模型显示
        -webkit-box-orient: vertical; // 甚至伸缩盒对象的子元素排列方式
        -webkit-line-clamp: 2; // 限制一个块元素显示文本的行数
        }
    }
    .right{
        display: flex;
        margin-right: 5px;
        img{
            float: right;
            width: 17px;
            height: 26px;
        };  
    }
}
</style>